import axios from "../utils/axios";
export let getList = ()=>{
    return (dispatch)=>{
        axios.get("/list").then(res=>{
            console.log(res.data);
            dispatch({
                type:"getList",
                payload:res.data
            })
        })
    }
}
export let addshop = (item)=>{
    return {
        type:"addshop",
        payload:item
    }

}
export let addNum = (id)=>{ // 3步走的第二步
      return {
          type:"addnum",
          payload:id
      }
}
export let delfn = (id)=>{
    return {
        type:"delfn",
        payload:id
    }
}
export let checkAll = ()=>{
    return {
        type:"checkAll"
    }
}
export let checkitem = (id)=> {
    return {
        type:"checkitem",
        payload:id
    }
}
export let orderfn = (arr)=>{
    return {
        type:"checkitem1",
        payload:arr
    }
}
export let getAddressList = ()=>{
   return {
       type:"getAddressList"
   }
}
export let addform = (item) => {
    return {
        type:"addform",
        payload:item
    }
}
export let delfn1 = (index) => {
    return {
        type:"delfn1",
        payload:index
    }
}
export let editfn = (item) => {
    return {
        type: "editfn",
        payload:item
    }
}
export let onDown = ()=>{
    return {
        type:"onDown"
    }
}
export let onUp = ()=>{
    return {
        type:"onUp"
    }
}